<?php

namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Models\Admin\OperationLog;

class AdminAuth
{
    /**
     * 判断是否登录中间件
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        // $uid= Auth::guard('web')->user()->id;  
        // $id = Auth::id();

        // dd(\auth('web')->check());
        if (!\auth('web')->check()) {
            return redirect('admin/auth/login');
        }
        return $next($request);
    }
}
